#ifndef __SOURCE_AGORA_H__
#define __SOURCE_AGORA_H__

#include <list>
#include "al/al.h"
#include "al/alc.h"
#include "ISource.h"

class Source : public ISource
{
public:
	Source(ALenum format, ALsizei freq, bool run = true);
	~Source();
	void AddSamples(void *, unsigned int size);
	void SetPosition();
	void SetMaxBuffer();
	int  GetFormat();
	int  GetFrequence();
	void SetFormat(ALenum format);
	void SetFrequence(ALsizei freq);
	void Start();
	void Stop();
	void Clear();
	bool IsRunning();

private:
	bool Source::checkRun();

	bool				_run;
	ALenum				_format;
	ALsizei				_freq;
	std::list<ALuint>	_freeALBuf;
	std::list<ALuint>	_usedALBuf;
	ALuint				_source;
};


#endif